package com.tedu.demo8;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Demo {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext("com.tedu.demo8");
        Person p = context.getBean(Person.class);
        System.out.println("Spring返回了Person，可以使用该对象"+p);
        context.close();//关闭Spring容器，Spring会销毁所有管理的对象
    }
}
